package com.example.administrator.hqq.config;

/**
 * @name: HQQ
 * @describe:用于控制网络请求IP地址
 * @author: 康海涛 QQ2541849981
 * @time: 2018/10/29 17:14
 * @remark:
 */
public class ENV {
    //内网ip 131
    //预上线 242
    public static int ip = 131;
    public static int packageType = 1;
    public static boolean release = false;
    //测试环境
    private static String baseTestHost = "http://192.168.1." + ip + ":8000";
    //预上线
    private static String basePreReleaseHost = "http://39.96.186.86:8000";
    //正式环境
    private static String baseReleaseHost = "https://www.hqq-api.com:8879";

    /**
     * @return
     */
    private static String getBaseHost() {
        if (!release && 1 == packageType) {
            return baseTestHost;
        } else if (!release && 1 != packageType) {
            return basePreReleaseHost;
        } else {
            return baseReleaseHost;
        }
    }
    public static String getUmTag(){
        if (!release && 1 == packageType) {
            return "开发";
        } else if (!release && 1 != packageType) {
            return "测试";
        } else {
            return "生产";
        }
    }
    /**
     * 获取接口域名
     * @return 接口域名
     */
    static String getHttpHost() {
        return getBaseHost();
    }
}
